
/***检测邮箱格式***/
function checkEmail() {
	var email = $("#account").val();
	var patten = new RegExp(/^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]+$/);
	var bcheck = patten.test(email);
	if (!bcheck) {
		$("#acc_info").html("\u90ae\u7bb1\u683c\u5f0f\u4e0d\u6b63\u786e");
	}
	return bcheck;
}
/***检测邮箱是否为空***/
function checkEmailIsNull() {
	if ($("#account").val() <= 0) {
		$("#acc_info").html("\u8d26\u53f7\u4fe1\u606f\u4e0d\u80fd\u4e3a\u7a7a");
		return false;
	} else {
		return true;
	}
}
/***检验两次密码是否相同***/
function confirmPass() {
	if ($("#password1").val() != $("#password").val()) {
		$("#pass_info1").html("两次密码不相同");
		return false;
	} else {
		return true;
	}
}
/***验证密码长度***/
function checkPassword() {
	if ($("#password").val().length < 6) {
		$("#pass_info").html("\u5bc6\u7801\u957f\u5ea6\u9700\u8981\u5927\u4e8e6");
		return false;
	} else {
		return true;
	}
}
//验证账号是否被注册
function ajaxCheckAcc(){
	var email = $("#account").val();
		if (email == null || email == "") {
			$("#acc_info").html("\u8d26\u53f7\u4e0d\u80fd\u4e3a\u7a7a");
			return false;
		} else {
			if (checkEmail()) {
				jQuery.ajax({type:"GET", contentType:"application/json", data:{account:$("#account").val()}, url:"checkAcc.do", dataType:"json", success:function (data) {
					if (data.success == "true") {
						$("#acc_info").html("\u90ae\u7bb1\u5c1a\u672a\u88ab\u6ce8\u518c");
						return false;
					} else {
						if (data.success == "false") {
							$("#acc_info").html("\u90ae\u7bb1\u5df2\u7ecf\u88ab\u6ce8\u518c");
							return true;
						}
					}
				}, error:function () {
					alert("error");
					return false
				}});
			return true;
			} else {
				return false;
			}
		}
}
/****检验是否同意注册协议****/
function isAgree(){

	//alert($("#agree_box").attr("checked"));
	if($("#agree_box").attr("checked")){
		$("#agree_info").html("");
		return true;
	}else{
		$("#agree_info").html("不同意注册协议？");
		return false;
	}
}
